<template>
  <el-image
    v-if="src"
    :style="cssStyle"
    :src="firstImage"
    :preview-src-list="fileList"
  />
</template>

<script>
export default {
  name: "HzLink",
  props: {
    src: {
      type: String,
      default: "",
    },
    cssStyle: {
      type: String,
      default: "common",
    },
  },
  data() {
    return {};
  },
  watch: {},
  computed: {
    fileList: {
      get: function () {
        //必须有返回值，用来获取属性，称为get函数
        if (!this.src) {
          return [];
        }
        let result = this.src.split(",");
        return result;
      },
    },
    firstImage: {
      get: function () {
        //必须有返回值，用来获取属性，称为get函数
        if (!this.src) {
          return "";
        }
        let result = this.src.split(",");
        return result[0];
      },
    },
  },

  created() {},
  methods: {},
};
</script>
